﻿using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Windows.Input;
using InseSoft.Infraestructure;
using InseSoft.Models.Entities;
using InseSoft.Views;
using Ninject;

namespace InseSoft.ViewModels
{
    [DebuggerNonUserCode]
    public class TestWindowViewModel : ObservableObject
    {
        public TestWindowViewModel()
        {
            CatalogSearchViewModel.RecordList = LoadEntities();
        }

        [Inject]
        public CatalogSearchViewModel CatalogSearchViewModel { get; set; }
        //public EmpresaViewModel EmpresaViewModel { get; set; }

        #region Commands

        public ICommand EmpresasCommand
        {
            get { return new RelayCommand(() => new EmpresaWindow().Show()); }
        }

        #endregion

        public ObservableCollection<CatalogEntity> LoadEntities()
        {
            var result = new ObservableCollection<CatalogEntity>
                {
                    new Empresa {Id = 1, Nombre = "Marcela"},
                    new Empresa {Id = 2, Nombre = "Marco"},
                    new Empresa {Id = 3, Nombre = "Matías"},
                    new Empresa {Id = 4, Nombre = "Lía"},
                };

            //for (var i = 0; i < 100000; i++)
            //{
            //    result.Add(new Empresa { Id = i + 5, Nombre = "Automatico #" + i });
            //}

            return result;
        }
    }
}
